home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Util / Misc / Lottery2002.lha / Lottery2002 / Source / common.c next >
C/C++ Source or Header  |  2001-01-25  |  1KB  |  48 lines

  1. /* common.c */
  2.  
  3. #include "includes.h"
  4. #include "externals.h"
  5.  
  6. /* requester, putbusy, clearbusy
  7.    these function's are used by most of the modules */
  8.  
  9. /* Puts up a requester using easy request */
  10. long requester (char *title, char *text, char *buttons)
  11. {
  12.     struct EasyStruct myES =
  13.     {
  14.         sizeof(struct EasyStruct),
  15.         0,
  16.         title,
  17.         "%s",
  18.         "%s"
  19.     };
  20. return(EasyRequest(NULL, &myES, NULL, text, buttons));
  21. }
  22. /* ---------------------------------------------------------------------- */
  23. /* To use set up as follow's  **
  24. ** struct Requester    myreq; **
  25. ** putbusy(win, &myreq);      **
  26. **      then to clear         **
  27. ** clearbusy(win, &myreq);    */
  28.  
  29. /* Puts up a busy pointer & blocks window input */
  30. void putbusy(struct Window *win)
  31. {
  32.     SetWindowTitles(win, (UBYTE *)-1, g_scrtitle);
  33.     InitRequester(&myreq);
  34.     if (Request(&myreq, win))
  35.     {
  36.         SetWindowPointer(win, WA_BusyPointer,    TRUE,
  37.                                          WA_PointerDelay,    TRUE,
  38.                                          TAG_END);
  39.     }
  40. }
  41. /* ---------------------------------------------------------------------- */
  42. /* Clears busy pointer & allows window input */
  43. void clearbusy(struct Window *win)
  44. {
  45.     ClearPointer(win);
  46.     EndRequest(&myreq, win);
  47. }
  48.